Ich habe folgende Änderung in den Quelldaten vorgenommen. 

hal.cc  	(Änderungen nötig da sonst nicht automatisch in den manual gewechselt wird.)
Zeile		1004 auskommentiert //enableMdiMode(enabled);  
Zeile		1053 auskommentiert //enableMdiMode(enabled); 
Zeile		1061 auskommentiert //enableMdiMode(enabled); 
Zeile		1134 auskommentiert //enableMdiMode(enabled);

pedant.cc 	(Handrad bringt auf Stellung LEAD einen andere Adresse)
Zeile    	385 Adresse 0x1c in 0x9b geänert  //lead(0x9b, "Lead", ""),


Damit das XHC-WHB04B-4 funktioniert brauchen wir einen "Treiber" bzw. eine Komponente die mit dem USB Adapter kommuniziert.

Schritt 1
	USB Adapter einstecken und ggf. Debian neustarten.

Schritt 2
	Terminal öffnen und mit dem Befehl lsusb überprüfen ob er erkannt wurde.

>	lsusb
	Bus 001 Device 003: ID 10ce:eb93 Silicon Labs 

	ID 10ce:eb93  ist unser Kanditat

Schritt 3
	Für diesen Schritt bietet es sich an den Dateimanager aus dem Terminal zu starten.
	Bei mir geht das mit "sudo caja"  ( caja ist der Name des Dateimanger, kann bei euch anders sein)

	Datei "99-xhc-whb04b-6.rules" nach  /etc/udev/rules.d/  kopieren.
    
    oder 

    Eine Datei anlegen mit folgender Zeile

	ATTR{idProduct}=="eb93", ATTR{idVendor}=="10ce", MODE="0666", OWNER="root", GROUP="plugdev" 

	Dann im Terminal den Befehl "sudo udevadm trigger" ausführen. Evtl. den USB Apadter einmal abziehen und wieder einstecken.


Schritt 4
	Die Quelldaten im Ordner xhc-whb04b-6 müssen auf eurem System kompiliert werden.
	Wenn bei den nächsten Schritten irgendetwas fehlen sollte (Pakete, Tools usw.) dann schaut mal auf ...
	http://www.linuxcnc.org/docs/master/html/code/building-linuxcnc.html

    Ok der Anfang wird mit git gemacht. Also die LinuxCNC Quelldaten werden heruntergeladen und in einem Ordner gespeichert. 

    Im Terminal folgendes eingeben.  
>	git clone https://github.com/LinuxCNC/linuxcnc linuxcnc-dev
	linuxcnc-dev ist dann der Zielordner der automatisch angelegt wird

    Danach müssen wir den Ordner xhc-whb04b-6 in linuxcnc-dev/src/hal/user_comps/  kopieren und das Make file unter linuxcnc-dev/src/ anpassen.
    
    Im Make file gibt es folgenden Abschnitt (SUBDIRS). Es muss nach hal/user_comps/huanyang-vfd \  eine Zeile mit hal/user_comps/xhc-whb04b-6 \ 
	ergänzt werden damit dies später kompiliert wird.

	#############################################################################################    
	# Submakefiles from each of these directories will be included if they exist
	SUBDIRS := \
    libnml/linklist libnml/cms libnml/rcs libnml/inifile libnml/os_intf \
    libnml/nml libnml/buffer libnml/posemath libnml \
    \
    rtapi/examples/timer rtapi/examples/semaphore rtapi/examples/shmem \
    rtapi/examples/extint rtapi/examples/fifo rtapi/examples rtapi \
    \
    hal/components hal/drivers hal/drivers/mesa-hostmot2 \
    hal/user_comps/devices hal/user_comps/mb2hal \
    hal/user_comps hal/user_comps/vismach hal/user_comps/vfs11_vfd hal/classicladder hal/utils hal \
    hal/user_comps/vfdb_vfd hal/user_comps/wj200_vfd \
    hal/user_comps/huanyang-vfd \
    hal/user_comps/xhc-whb04b-6 \

	#############################################################################################

Schritt 5
	Nun können wir kompilieren.... Aber wie :-)
	Terminal öffnen und folgende Befehle ausführen.

>	cd linuxcnc-dev
>   cd src
>   ./autogen.sh
>   ./configure --with-realtime=uspace
>   make
>   sudo make setuid


Schritt 6
	Das BIN File von xch-whb04b-6 muss nun kopiert werden.
    
    von 	/linuxcnc-dev/bin/
    nach 	/usr/bin/
    
	Hier bietet es sich wieder an den Dateimanger mit sudo aus dem Terminal zu starten.

Schritt 7
	Alles schließen und das Terminal öffen.
	Folgende Befehle um einen Test mit dem Handrad zu machen.

>	halrun
>	loadusr xhc-whb04b-6

Schritt 8
	In eine bestehende LinuxCNC Maschine integrieren.
	
	Dazu legt man sich am besten eine seperate hal Datei an und ruft diese über die Maschine INI auf.
 	
	#MASCHINEN INI

	[HAL]
    HALFILE = xhc-whb04b-6.hal


    In der zusätzlichen HAL muss der Befehl loadusr xhc-whb04b-6 -H stehen damit die Komponente geladen wird.
	
	#xhc-whb04b-6 HAL

	loadusr -W xhc-whb04b-6 -H 


 	Danach sollte die Verknüpfungen zwischen Komponente und den LinuxCNC PINS geschrieben werden.
	









	Folgend noch ein Beispiel zur INI und HAL


	Mein INI Beispiel
	#################


	[HAL]
	HALUI = halui
	HALFILE = 7i76e.hal
	HALFILE = custom.hal
	HALFILE = xhc-whb04b-6.hal
	POSTGUI_HALFILE = postgui_call_list.hal
	SHUTDOWN = shutdown.hal


	[HALUI]
	MDI_COMMAND=(debug,00)
	MDI_COMMAND=(debug,macro1)
	MDI_COMMAND=(debug,macro2)
	MDI_COMMAND=(debug,macro3)
	MDI_COMMAND=(debug,macro4)
	MDI_COMMAND=G1 G53 X0 Y0 Z0 F4000
	MDI_COMMAND=(debug,macro6)
	MDI_COMMAND=G1 X0 Y0 Z0 F4000
	MDI_COMMAND=(debug,macro8)
	MDI_COMMAND=(debug,macro9)
	MDI_COMMAND=(debug,macro10)
	MDI_COMMAND=(debug,macro11)
	MDI_COMMAND=(debug,macro12)
	MDI_COMMAND=(debug,macro13)
	MDI_COMMAND=(debug,macro14)
	MDI_COMMAND=(debug,macro15)
	MDI_COMMAND=(debug,macro16)
	MDI_COMMAND=G1 G53 Z0 F4000
	MDI_COMMAND=(debug,macro17)
	MDI_COMMAND=(debug,macro18)
	MDI_COMMAND=(debug,macro19)






	Mein HAL Beispiel
	#################


	# ######################################################################
	# WHB04B-6 jog dial configuration
	# ######################################################################

	# BEGIN Note: spindle signals are ususally listed in the main .hal file
	#
	#net  spindle.is-on                      motion.spindle-on
	#net  spindle.start                      halui.spindle.start         
	#net  spindle.stop                       halui.spindle.stop
	#net  spindle.forward                    halui.spindle.forward
	#
	#net  spindle.reverse                    halui.spindle.reverse
	#net  spindle.runs-forward               motion.spindle-forward     
	#net  spindle.runs-reverse               motion.spindle-reverse
	#
	#net  spindle.increase                   halui.spindle.increase
	#net  spindle.decrease                   halui.spindle.decrease
	#net  spindle.spindle-override.value     halui.spindle-override.value
	#net  spindle.spindle-override.increase  halui.spindle-override.increase
	#net  spindle.spindle-override.decrease  halui.spindle-override.decrease
	#
	#net  spindle.velocity.abs-rpm           motion.spindle-speed-out-abs
	#
	# END Note

	# ######################################################################
	# Load components
	# ######################################################################
	loadusr -W xhc-whb04b-6 -H 

	loadrt ilowpass names=ilowpass.jog.x,ilowpass.jog.y,ilowpass.jog.z,ilowpass.jog.a
	addf   ilowpass.jog.x       servo-thread
	addf   ilowpass.jog.y       servo-thread
	addf   ilowpass.jog.z       servo-thread
	addf   ilowpass.jog.a       servo-thread
	setp   ilowpass.jog.x.scale 100
	setp   ilowpass.jog.y.scale 100
	setp   ilowpass.jog.z.scale 100
	setp   ilowpass.jog.a.scale 100
	setp   ilowpass.jog.x.gain  0.01
	setp   ilowpass.jog.y.gain  0.01
	setp   ilowpass.jog.z.gain  0.01
	setp   ilowpass.jog.a.gain  0.01

	loadrt scale names=scale.axis.x,scale.axis.y,scale.axis.z,scale.axis.a
	addf   scale.axis.x         servo-thread
	addf   scale.axis.y         servo-thread
	addf   scale.axis.z         servo-thread
	addf   scale.axis.a         servo-thread
	setp   scale.axis.x.gain    0.01 
	setp   scale.axis.y.gain    0.01 
	setp   scale.axis.z.gain    0.01
	setp   scale.axis.a.gain    0.01  
	setp   scale.axis.x.offset  0
	setp   scale.axis.y.offset  0
	setp   scale.axis.z.offset  0
	setp   scale.axis.a.offset  0

	# ######################################################################
	# Signals configuration
	# ######################################################################

	# Connect emergency stop signals
	net  pdnt.machine.is-on                  halui.machine.is-on                whb.halui.machine.is-on
	net  pdnt.machine.on                     whb.halui.machine.on               halui.machine.on
	net  pdnt.machine.off                    whb.halui.machine.off              halui.machine.off

	# Connect program related signals
	net  pdnt.program.is-idle                whb.halui.program.is-idle          halui.program.is-idle
	net  pdnt.program.is-paused              whb.halui.program.is-paused        halui.program.is-paused
	net  pdnt.program.is-running             whb.halui.program.is-running       halui.program.is-running
	net  pdnt.program.resume                 whb.halui.program.resume           halui.program.resume
	net  pdnt.program.pause                  whb.halui.program.pause            halui.program.pause
	net  pdnt.program.run                    whb.halui.program.run              halui.program.run
	net  pdnt.program.stop                   whb.halui.program.stop             halui.program.stop

	# Connect "selected axis" signals    
	net  pdnt.joint.X.select                 whb.halui.joint.x.select           halui.joint.0.select
	net  pdnt.joint.Y.select                 whb.halui.joint.y.select           halui.joint.1.select
	net  pdnt.joint.Z.select                 whb.halui.joint.z.select           halui.joint.2.select
	#net pdnt.joint.A.select                 whb.halui.joint.a.select           halui.joint.3.select


	# Connect jog signals for step and continuous mode
	#net  pdnt.stepgen.00.maxvel              hpg.stepgen.00.maxvel              whb.stepgen.00.maxvel
	#net  pdnt.stepgen.01.maxvel              hpg.stepgen.01.maxvel              whb.stepgen.01.maxvel
	#net  pdnt.stepgen.02.maxvel              hpg.stepgen.02.maxvel              whb.stepgen.02.maxvel
	#net pdnt.stepgen.03.maxvel              hpg.stepgen.03.maxvel              whb.stepgen.03.maxvel

	#net  pdnt.stepgen.00.position-scale      hpg.stepgen.00.position-scale      whb.stepgen.00.position-scale
	#net  pdnt.stepgen.01.position-scale      hpg.stepgen.01.position-scale      whb.stepgen.01.position-scale
	#net  pdnt.stepgen.02.position-scale      hpg.stepgen.02.position-scale      whb.stepgen.02.position-scale
	#net pdnt.stepgen.03.position-scale      hpg.stepgen.03.position-scale      whb.stepgen.03.position-scale


	net  pdnt.axis.0.jog-scale               whb.axis.0.jog-scale               scale.axis.x.in      
	net  pdnt.axis.1.jog-scale               whb.axis.1.jog-scale               scale.axis.y.in      
	net  pdnt.axis.2.jog-scale               whb.axis.2.jog-scale               scale.axis.z.in  
	#net  pdnt.axis.3.jog-scale               whb.axis.3.jog-scale               scale.axis.a.in     

	net  scale.axis.0.jog-scale              scale.axis.x.out                   axis.x.jog-scale
	net  scale.axis.1.jog-scale              scale.axis.y.out                   axis.y.jog-scale
	net  scale.axis.2.jog-scale              scale.axis.z.out                   axis.z.jog-scale
	#net  scale.axis.3.jog-scale              scale.axis.a.out                   axis.a.jog-scale

	net  pdnt.axis.0.jog-counts              whb.axis.0.jog-counts              ilowpass.jog.x.in
	net  pdnt.axis.1.jog-counts              whb.axis.1.jog-counts              ilowpass.jog.y.in
	net  pdnt.axis.2.jog-counts              whb.axis.2.jog-counts              ilowpass.jog.z.in
	#net  pdnt.axis.3.jog-counts              whb.axis.3.jog-counts              ilowpass.jog.a.in

	net  pdnt.ilowpass.jog.0.jog-counts      ilowpass.jog.x.out                 axis.x.jog-counts
	net  pdnt.ilowpass.jog.1.jog-counts      ilowpass.jog.y.out                 axis.y.jog-counts
	net  pdnt.ilowpass.jog.2.jog-counts      ilowpass.jog.z.out                 axis.z.jog-counts
	#net  pdnt.ilowpass.jog.3.jog-counts      ilowpass.jog.a.out                 axis.a.jog-counts

	net  pdnt.axis.0.jog-enable              whb.axis.0.jog-enable              axis.x.jog-enable
	net  pdnt.axis.1.jog-enable              whb.axis.1.jog-enable              axis.y.jog-enable
	net  pdnt.axis.2.jog-enable              whb.axis.2.jog-enable              axis.z.jog-enable
	#net pdnt.axis.3.jog-enable               whb.axis.3.jog-enable              axis.a.jog-enable

	net  pdnt.axis.0.jog-vel-mode            whb.axis.0.jog-vel-mode            axis.x.jog-vel-mode
	net  pdnt.axis.1.jog-vel-mode            whb.axis.1.jog-vel-mode            axis.y.jog-vel-mode
	net  pdnt.axis.2.jog-vel-mode            whb.axis.2.jog-vel-mode            axis.z.jog-vel-mode
	#net pdnt.axis.3.jog-vel-mode            whb.axis.3.jog-vel-mode            axis.a.jog-vel-mode


	# Connect macro buttons to mdi commands

	net pdnt.macro.1                        whb.button.macro-1                 halui.mdi-command-01
	net pdnt.macro.2                        whb.button.macro-2                 halui.mdi-command-02
	net pdnt.macro.3                        whb.button.macro-3				   halui.mdi-command-03
	net pdnt.macro.4                        whb.button.macro-4                 halui.mdi-command-04

	net pdnt.macro.6                        whb.button.macro-6                 halui.mdi-command-06
		         
	net pdnt.macro.8                        whb.button.macro-8                 halui.mdi-command-08
	net pdnt.macro.9                        whb.button.macro-9                 halui.mdi-command-09
	net pdnt.macro.10                       whb.button.macro-10                halui.mdi-command-10

	net pdnt.macro.11                       whb.button.macro-11                halui.mdi-command-11
	net pdnt.macro.12                       whb.button.macro-12                halui.mdi-command-12
	net pdnt.macro.13                       whb.button.macro-13                halui.home-all
	net pdnt.macro.14                       whb.button.macro-14                halui.mdi-command-14
	net pdnt.macro.15                       whb.button.macro-15                halui.mdi-command-15
	net pdnt.macro.16                       whb.button.macro-16                halui.mdi-command-16


	# Connect reset, stop, start/pause/resume buttons to halui
	# toggles whb.halui.estop.{activate, reset} which are
	# already connected to halui.estop.{activate, reset} via whb.halui.estop.{activate, reset}
	net  pdnt.button.reset                   whb.button.reset
	# already linked to halui.program.stop via whb.program.stop
	net  pdnt.button.stop                    whb.button.stop
	# toggles whb.halui.program{run, pause, resume} which are 
	# already connected to halui.program.{run, pause, resume} via whb.halui.program.{run, pause, resume}
	net  pdnt.button.start-pause             whb.button.start-pause     

	# Connect special positions signals
	net  pdnt.button.m-home                  whb.button.m-home                  halui.mdi-command-05
	#net  pdnt.button.safe-z                  whb.button.safe-z                  halui.mdi-command-17

	net  pdnt.button.w-home                  whb.button.w-home                  halui.mdi-command-07
	net  pdnt.button.s-on-off                whb.button.s-on-off                halui.mdi-command-18

	# unused, just exposes pendant interna
	net pdnt.button.fn                       whb.button.fn

	# probe command
	net  pdnt.button.probe-z                 whb.button.probe-z                halui.mdi-command-19

	# unused, just exposes pendant interna
	net  pdnt.button.mode-continuous         whb.button.mode-continuous

	# unused, just exposes pendant interna
	net  pdnt.button.mode-step               whb.button.mode-step

	# Connect spindle related signals
	net  spindle.is-on                       whb.halui.spindle.is-on
	net  spindle.stop                        whb.halui.spindle.stop
	net  spindle.forward                     whb.halui.spindle.forward
	net  spindle.reverse                     whb.halui.spindle.reverse


	# min/max override depends on [DISPLAY]MIN_SPINDLE_OVERRIDE and [DISPLAY]MAX_SPINDLE_OVERRIDE
	net  spindle.spindle-override.value      whb.halui.spindle-override.value		halui.spindle.0.override.value
	net  spindle.spindle-override.increase   whb.halui.spindle-override.increase	halui.spindle.0.override.increase
	net  spindle.spindle-override.decrease   whb.halui.spindle-override.decrease	halui.spindle.0.override.decrease
	net  spindle.velocity.abs-rpm            whb.motion.spindle-speed-abs

	# Connect machine mode related signals
	net  pdnt.halui.mode.auto                whb.halui.mode.auto                halui.mode.auto
	net  pdnt.halui.mode.joint               whb.halui.mode.joint               halui.mode.joint
	net  pdnt.halui.mode.manual              whb.halui.mode.manual              halui.mode.manual
	net  pdnt.halui.mode.mdi                 whb.halui.mode.mdi                 halui.mode.mdi
	net  pdnt.halui.mode.is-auto             halui.mode.is-auto                 whb.halui.mode.is-auto
	net  pdnt.halui.mode.is-joint            halui.mode.is-joint                whb.halui.mode.is-joint
	net  pdnt.halui.mode.is-manual           halui.mode.is-manual               whb.halui.mode.is-manual
	net  pdnt.halui.mode.is-mdi              halui.mode.is-mdi                  whb.halui.mode.is-mdi

	# Connect feed rate related signals
	net  pdnt.halui.feed-override.scale        whb.halui.feed-override.scale        halui.feed-override.scale
	net  pdnt.halui.feed-override.direct-val   whb.halui.feed-override.direct-val   halui.feed-override.direct-value
	net  pdnt.halui.feed-override.counts       whb.halui.feed-override.counts       halui.feed-override.counts
	#net  pdnt.halui.feed-override.count-enable whb.halui.feed-override.count-enable halui.feed-override.count-enable
	#net  pdnt.halui.feed-override.value        halui.feed-override.value            whb.halui.feed-override.value
	setp                                       whb.halui.feed-override.min-value    [DISPLAY]MIN_FEED_OVERRIDE
	setp                                       whb.halui.feed-override.max-value    [DISPLAY]MAX_FEED_OVERRIDE

	# min/max override depends on [DISPLAY]MIN_FEED_OVERRIDE and [DISPLAY]MAX_FEED_OVERRIDE
	net  pdnt.halui.feed-override.increase   whb.halui.feed-override.increase   halui.feed-override.increase
	net  pdnt.halui.feed-override.decrease   whb.halui.feed-override.decrease   halui.feed-override.decrease
	#net  pdnt.button.feed-plus               whb.button.feed-plus
	#net  pdnt.button.feed-minus              whb.button.feed-minus
		 

	# For printing the speed F:xxxx on display, the motion.current-vel velocity is used.
	net  pdnt.motion.current-vel             motion.current-vel                 whb.motion.current-vel

	# Connect axis position related signals
	net  pdnt.halui.axis.0.pos-feedback      halui.axis.x.pos-feedback          whb.halui.axis.0.pos-feedback
	net  pdnt.halui.axis.1.pos-feedback      halui.axis.y.pos-feedback          whb.halui.axis.1.pos-feedback
	net  pdnt.halui.axis.2.pos-feedback      halui.axis.z.pos-feedback          whb.halui.axis.2.pos-feedback
	#net  pdnt.halui.axis.3.pos-feedback      halui.axis.a.pos-feedback          whb.halui.axis.3.pos-feedback

	net  pdnt.halui.axis.0.pos-relative      halui.axis.x.pos-relative          whb.halui.axis.0.pos-relative
	net  pdnt.halui.axis.1.pos-relative      halui.axis.y.pos-relative          whb.halui.axis.1.pos-relative
	net  pdnt.halui.axis.2.pos-relative      halui.axis.z.pos-relative          whb.halui.axis.2.pos-relative
	#net  pdnt.halui.axis.3.pos-relative      halui.axis.a.pos-relative          whb.halui.axis.3.pos-relative


		



		






